package com.ht.demo.service.constans;


import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "system")
public class SystemConfig {
    /**
     * 用户密码加密密钥
     **/
    public static String passwordMd5Key;
    /** 系统密钥 **/
    public static String secretKey;
    /** 是否开启系统签名校验 **/
    public static Boolean signSwitch;
    /** 是否开启强制登录 **/
    public static Boolean loginSwitch;
    /** 是否开启登录验证码校验 **/
    public static Boolean captchaEnabled;
    /** 验证码类型：数学计算-math，字符-char **/
    public static String captchaType;
    /** 获取ip地址开关 **/
    public static Boolean addressEnabled;

    public static String env;

    public void setPasswordMd5Key(String passwordMd5Key) { SystemConfig.passwordMd5Key = passwordMd5Key; }

    public void setSecretKey(String secretKey) {
        SystemConfig.secretKey = secretKey;
    }

    public void setSignSwitch(Boolean signSwitch) {
        SystemConfig.signSwitch = signSwitch;
    }

    public void setLoginSwitch(Boolean loginSwitch) {
        SystemConfig.loginSwitch = loginSwitch;
    }

    public void setCaptchaEnabled(Boolean captchaEnabled) {
        SystemConfig.captchaEnabled = captchaEnabled;
    }

    public void setCaptchaType(String captchaType) {
        SystemConfig.captchaType = captchaType;
    }

    public void setAddressEnabled(Boolean addressEnabled) {
        SystemConfig.addressEnabled = addressEnabled;
    }

    public void setEnv(String env) {
        SystemConfig.env = env;
    }

    //    get方法===============================


    public static String getEnv() {
        return env;
    }

    public static String getSecretKey() {
        return secretKey;
    }

    public static Boolean getSignSwitch() {
        return signSwitch;
    }

    public static Boolean getLoginSwitch() {
        return loginSwitch;
    }

    public static Boolean getCaptchaEnabled() {
        return captchaEnabled;
    }

    public static String getCaptchaType() {
        return captchaType;
    }

    public static String getPasswordMd5Key() {
        return passwordMd5Key;
    }

}
